<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        document.write("顾客在商场购买的清单：<br>");
        document.write("《JavaScript》单价为59.00<br>");
        document.write("钢笔单价为30.00<br>");
        document.write("眼睛单价为199.00<br>");
        document.write("牛奶单价为68.00<br>");
        var a1=prompt("请输入购买的《JavaScript》书的数量","2");
        var a2=prompt("请输入购买的钢笔的数量","3");
        var a3=prompt("请输入购买的眼睛的数量","1");
        var a4=prompt("请输入购买的牛奶的数量","4");
         if(a1>='4'){
             a1=(59.00*4)*0.65;
         }else if(a1=='3'){
             a1=(59.00*3)*0.7;
         }else if(a1=='2'){
             a1=(59.00*2)*0.8;
         }else if(a1=='1'){
             a1=(59.00*1)*0.9;
         }else{
             a1=0;
         }


         if(a2>='4'){
            a2=(30.00*4)*0.65;
         }else if(a2=='3'){
            a2=(30.00*3)*0.7;
         }else if(a2=='2'){
            a2=(30.00*2)*0.8;
         }else if(a2=='1'){
            a2=(30.00*1)*0.9;
         }else{
             a2=0;
         }


         if(a3>='4'){
             a3=(199.00*4)*0.65;
         }else if(a3=='3'){
             a3=(199.00*3)*0.7;
         }else if(a3=='2'){
             a3=(199.00*2)*0.8;
         }else if(a3=='1'){
             a3=(199.00*1)*0.9;
         }else{
             a3=0;
         }


         if(a4>='4'){
             a4=(68.00*4)*0.65;
         }else if(a4=='3'){
             a4=(68.00*3)*0.7;
         }else if(a4=='2'){
             a4=(68.00*2)*0.8;
         }else if(a4=='1'){
             a4=(68.00*1)*0.9;
         }else{
             a4=0;
         }
        var zong=a1+a2+a3+a4;
        document.write(zong+"元");
    </script>
</body>
</html>